package com.mycompany.j2eem.Mapper.ghymapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
*
* @author 高鸿赟
*/
public interface TagMapper {
    //获取图片id的点赞次数

    //获取Account_id
    @Select("SELECT id from Account where username =#{username}")
    String get_Account_id(@Param("username") String username);

    //获取Picture_id
    @Select("SELECT Picture_id from LikePicture where username =#{username}")
    String get_Like_Picture(@Param("Picture_id") String Picture_id);

    //根据标签id获取相应标签的名字
    @Select("SELECT tagname from TagName where id =#{id}")
    String get_tag_name(@Param("id") String tagid);

    //根据标签id获取图片id
    //wucy改
    @Select("SELECT id from Picture,Picture_Attritube where TagName_id =#{TagName_id} and Picture_id = Picture.id")
    List get_picture_id(@Param("TagName_id") String TagName_id);

    //根据字符返回可能存在的标签
    @Select("SELECT id from TagName where tagname=#{tagname}")
    String get_tag_id(@Param("TagName_id")String TagName_id);

}
